from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


op = webdriver.ChromeOptions()
op.add_experimental_option('excludeSwitches', ['enable-automation'])
op.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=op)
# driver.maximize_window()

driver.get("https://jqueryui.com/slider/#multiple-vertical")
iframe1 = driver.find_element(By.CSS_SELECTOR,'#content > iframe')
driver.switch_to.frame(iframe1)
# ele1 = driver.find_element(By.CSS_SELECTOR,'#master > span')
mouseTest = WebDriverWait(driver , 5 , 0.5)
ele1 = mouseTest.until(EC.presence_of_element_located((By.CSS_SELECTOR,'#master > span')))
ele2 = mouseTest.until(EC.presence_of_element_located((By.CSS_SELECTOR,'#eq > span:nth-child(3) > span')))
chains = ActionChains(driver)
chains.drag_and_drop_by_offset(ele1,xoffset=50,yoffset=0).perform()
chains.drag_and_drop_by_offset(ele2,xoffset=0,yoffset=-30).perform()



driver.quit()